package com.moonbird.springboot.service;

import com.moonbird.springboot.Utils.ppt.PPTGenerator;
import org.springframework.stereotype.Service;

import java.io.IOException;

@Service
public class PptService {
    public String generatePPT(String description) {
        try {
            String question = description;

            // 调用生成PPT的方法
            String base64PPTs = PPTGenerator.generatePPTs(question);

            // 返回base64编码的PPT
            return base64PPTs;

        } catch (IOException | InterruptedException e) {
            e.printStackTrace();
            System.err.println("An error occurred: " + e.getMessage());
        }
        return null;
    }
}
